package com.supermarket_project.controller;

import com.supermarket_project.common.R;
import com.supermarket_project.service.ActivityService;
import com.supermarket_project.service.ActivityTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("supermarket")
@CrossOrigin
public class ActivityTypeController {

    @Autowired
    ActivityTypeService activityTypeService;

    @RequestMapping(value = "/addOneActivityType",method = RequestMethod.POST)
    public R addOneActivityType_c(@RequestBody Map activity_type_map){
        R r=new R();
        r=activityTypeService.addOneActivityType_s(activity_type_map);
        return r;
    }

    @RequestMapping(value = "/getAllActivityTypeInfo",method = RequestMethod.GET)
    public R getAllActivityTypeInfo_c(){
        R r=new R();
        r=activityTypeService.getAllActivityTypeInfo_s();
        return r;
    }
}
